package viewer;

import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
import java.awt.event.*;

public class RoffModelInfoPanel extends JPanel {

    public RoffModelInfoPanel(int numVerts,
                              int numPolys,
                              int numEdges,
                              int numUniEdges,
                              boolean uniEdgesCounted,
                              int polySize,
                              int numTriangles) {
        this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

        JPanel offPanel = new JPanel();
        offPanel.setLayout(new GridLayout(0, 1));
        offPanel.add(new JLabel("Number of Verticies:   " + numVerts));
        offPanel.add(new JLabel("Number of Polygons:   " + numPolys));
        offPanel.add(new JLabel("Number of Edges:   " + numEdges));
        if (uniEdgesCounted) {
            offPanel.add(new JLabel("Number of Unique Edges:   " + numUniEdges));
        } else {
            offPanel.add(new JLabel("Number of Unique Edges:   Uncounted"));
        }
        offPanel.add(new JLabel("Edges in Largest Polygon:   " + polySize));
        offPanel.setBorder(BorderFactory.createTitledBorder(
                           BorderFactory.createEtchedBorder(),
                           "Current Off File")
                          );
        this.add(offPanel);

        JPanel meshPanel = new JPanel();
        meshPanel.setLayout(new GridLayout(0, 1));
        meshPanel.add(new JLabel("Number of Triangles:   " + numTriangles));
        meshPanel.setBorder(BorderFactory.createTitledBorder(
                           BorderFactory.createEtchedBorder(),
                           "Current Tessellated Mesh")
                          );
        this.add(meshPanel);
        
    }
}